{% extends "::layout.html.twig" %}
{% block title "List payements" %}
{% block content %}
{% include "EmoneyEpayBundle::left_menu.html.twig" %}
	<h1>Liste des payements</h1>
	<p>
	<select name="site_list" id="site_list">
	 {% for site in sitesList %}
	    <option value="{{ site.id }}"> {{ site.name }} </option>
	{% endfor %}
	</select>	
	</p>
	<div class="loading"></div>
	<div id="payementlisthtml">
	     {% include "EmoneyEpayBundle:Payement:listhtml.html.twig" %}
	</div>
<script>
	$(".loading").hide();
	$("#site_list").change(function(){
		$(".loading").show();
		var site_id = $("#site_list").val();
		var DATA = 'site_id=' + site_id;
		$.ajax({
			type: "POST",
			url: "{{ path('EmoneyEpayBundle_listpayementajax')}}",
			data: DATA,
			cache: false,
			success: function(data){
			$('#payementlisthtml').html(data);
			$(".loading").hide();
		}
		});
	return false;
	});
</script>
{% endblock %}
